﻿#include <iostream>
#include "SharePointerTest.h"
#include <functional>

using namespace std;
int main()
{

    std::shared_ptr<SharePointerTestA> spA(new SharePointerTestA());
    std::shared_ptr<SharePointerTestB> spB(new SharePointerTestB());
    std::cout<<"spA count : "<<spA.use_count()<<std::endl;

    spA->shared_from_this();

    std::function<void()> func_1 = [](){cout<<"hello world"<<endl;};
    //func_1();

    SharedPointerTestC testC;
    auto m_fun = [&testC](int x1)
    {
        testC.setValue(x1);
    };

    m_fun(56);

    return 0;
}
